package com.lzz.rabbitmq;

import com.lzz.entity.Student;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * queues = {"hello", "object"} 监听的队列
 * @author zhenzhen
 * @date 2018-12-20 下午4:15
 */
@Component
@RabbitListener(queues = {"hello", "object"})
public class HelloReceiver {
    @RabbitHandler
    public void process(String hello) {
        System.out.println("Receiver1："+ hello);
    }

    @RabbitHandler
    public void process(Student student) {
        System.out.println("receiver1:" + student);
    }
}
